*get packages
ssc install scatterfit
ssc install estout
ssc install center
ssc install coefplot
ssc install shapley2
ssc install ci2

*get data
clear
set mat 11000
import delimited "/Users/caseyklofstad/Dropbox/NSF Conspiracy Theory Surveys/spring 2022 survey/data/spring_2022_survey_useable_good_cases_only_drop_open_ends.csv"

*cd to paper folder
cd "/Users/caseyklofstad/Dropbox/NSF Conspiracy Theory Surveys/spring 2022 survey/white replacement paper"

***
***

*cull data
keep q26_1 q26_2 q24_3 q24_1 q24_2 q25_2 q25_1 q2 q4 q3_2 q3_3 q3_4 q3_5 q5 q6 q7 q11 ///
q12 q12 q13 q40_2 ctscale_1 ctscale_2 ctscale_3 ctscale_4 antiest_1 antiest_2 antiest_3 antiest_4 antiest_5 ///
q14 q15 q16 q45_2 q46_1 q46_2 q46_3 q46_4 q46_5 q46_6 mach_1 mach_2 mach_3 mach_4 ///
narc_1 narc_2 narc_3 narc_4 psyc_1 psyc_2 psyc_3 psyc_4 sadism_1 sadism_2 sadism_3 sadism_4 ///
q95_1 q95_2 q95_3 q95_4 q95_5 q96_1 q96_2 q96_3 q96_4 q96_5 q96_6 q96_7 q96_8 q96_9 q96_10 q96_11 q96_12 ///
q48_1 q48_2 q48_3 q48_4 q48_5 q74_1 q74_2 q74_3 scilit_1 scilit_2 scilit_3 scilit_4 scilit_5 scilit_1 ///
trust_exp trust_eco trust_sci trust_doc trust_leg trust_prf trust_fin ///
q84 q43_1 q43_2 q43_3 q43_4 q42_1 q42_2 q42_3 q59_1 q59_2 q59_3 q61_1 q61_2 q61_3 ///
q101_1 q101_2 q101_3 q83_1 q83_2 q83_3 q83_1 q75_1 q75_3 q75_5 q288_4 q288_5 q289_2 q289_4 q290_1 q290_2 q290_4 ///
q75_2 q75_4 q288_1 q288_2 q288_3 q289_1 q289_3 q289_5 q290_3 q290_5 q58_1 q58_2 q58_3 q58_4 ///
q60_1 q60_2 q60_3 q60_4 q71_1 q71_2 q71_3 q71_4 victim_1 victim_2 victim_3 victim_4 ///
q68_1 q68_2 q68_3 q68_4 q22_1 q22_2 q37_22 q22_3 q285 q100 q287_18 q287_19 q287_20 ///
q37_4 q37_15 q18_1 q287_17 q283_3 q17_7 covcons_1 covcons_2 covcons_3 covcons_4 ///
q283_1 q17_3 q17_4 q284_1 q17_2 q37_16 q18_2 q20_2 q20_3 q287_21 q37_1 q37_3 q99_3 ///
q99_1 q99_2 q39_6 q94 q49_1 q49_2 q49_3 conflict_3 conflict_4 conflict_5 conflict_6 /// 
conflict_7 conflict_8 q92_1 q92_3 q92_2 q92_4 q88 q38_1 q38_2 q39_1 q39_4 q39_2 ///
q39_3 q40_1 q104 q28 q3_1 q10 scilit_6 q83_4 q39_5

****
****

*WR beliefs
	*define value lables for these items
label define WR_label 1 "SD" 2 "D" 3 "N" 4 "A" 5 "SA"
	*flip Powerful politicians and corporate leaders are trying to replace white people in the U.S. with cheaper foreign laborers. (Q26_1) 
recode q26_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(WR_US)		
tab q26_1 WR_US
	*flip White people in Europe are being replaced with cheaper non-white workers because that is what powerful politicians and corporate leaders want. (Q26_2) 
recode q26_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(WR_EURO)		
tab q26_2 WR_EURO
label values WR_EURO WR_label
	*In the last 20 years, the government has deliberately discriminated against white Americans with its immigration policies. (Q24_3) 
recode q24_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(WR_discrim)		
tab q24_3 WR_discrim
label values WR_discrim WR_label
	*combine vars into summary index (alpha = .84)
pwcorr WR_US WR_EURO WR_discrim, sig
factor WR_US WR_EURO WR_discrim, ipf
alpha WR_US WR_EURO WR_discrim, gen(WR_ave)	
summarize WR_ave
		*label it
label variable WR_ave "Belief in White Replacement Index" 

	*get % agree/strongly agree
		*all cases
tab q26_1
tab q26_2
tab q24_3
	
		*just whites
tab q3_1
gen white=0
replace white=1 if q3_1==1
tab q3_1 white
label variable white "White"		
preserve
keep if white==1
tab q26_1
tab q26_2
tab q24_3
restore
	
	*diagnostic for appendix: corr w/ other CTs
		*The government is deliberately hiding the truth about how many immigrants live in this country. (Q24_1) 
recode q24_1  (1=5) (2=4) (3=3) (4=2) (5=1), gen(q24_1_flip)
tab q24_1 q24_1_flip	
		*The government is deliberately hiding the true cost of immigration to taxpayers and society. (Q24_2) 
recode q24_2  (1=5) (2=4) (3=3) (4=2) (5=1), gen(q24_2_flip)
tab q24_2 q24_2_flip
		*flip Immigration from Asia should be limited due to the coronavirus pandemic. (Q25_2) 
recode q25_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q25_2_flip)	
tab q25_2 q25_2_flip
		*flip Immigrants from Asia have a positive impact on the United States. (Q25_1) 
recode q25_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q25_1_flip)	
tab q25_1 q25_1_flip

		*run corr analyses
pwcorr WR_ave q24_1_flip, sig	
pwcorr WR_ave q24_2_flip, sig	
pwcorr WR_ave q25_2_flip, sig
pwcorr WR_ave q25_1_flip, sig


****
****

*clean demogs
	*sex (q2)
tab q2
gen female=.
replace female=1 if q2==2
replace female=0 if q2==1
tab q2 female
label variable female "Female" 

	*hispanic (q4)
tab q4
gen hispanic=.
replace hispanic=1 if q4==1
replace hispanic=0 if q4==2
tab q4 hispanic
label variable hispanic "Latinx" 

	*race (q3)
		*white: this was already made above in section on the DV
		*black
tab q3_2
gen black=0
replace black=1 if q3_2==1
tab q3_2 black
label variable black "Black" 
		*asian, PI
tab q3_3
gen asian=0
replace asian=1 if q3_3==1
tab q3_3 asian
label variable asian "Asian" 
		*native am
tab q3_4
gen natamer=0
replace natam=1 if q3_4==1
tab q3_4 natamer
label variable natamer "Native Am." 
		*other
tab q3_5
gen race_oth=0
replace race_oth=1 if q3_5==1
tab q3_5 race_oth
label variable race_oth "Race, Other"

	*income (q5)
tab q5
gen income=q5
tab q5 income
label variable income "Income" 

	*education (q6)
tab q6
gen educ=q6
tab q6 educ
label variable educ "Education" 

	*age, from year born (q7)
gen age=2022-q7
summarize age
label variable age "Age"
		*make groupings for demog table
gen agegroup=.
replace agegroup=1 if age<=24
replace agegroup=2 if (age>24 & age<=44)
replace agegroup=3 if (age>44 & age<=64)
replace agegroup=4 if (age>=65)
tab agegroup

*gen 7-point party id (q9-12) to run DEM-REP
gen demrep7=.
replace demrep7=1 if q11==1
replace demrep7=2 if q11==2
replace demrep7=3 if q12==2
replace demrep7=4 if q12==3
replace demrep7=5 if q12==1
replace demrep7=6 if q10==2
replace demrep7=7 if q10==1
tab demrep7
tab demrep7 q11
tab demrep7 q10
tab demrep7 q12
label variable demrep7 "Party ID (Dem-Rep)"
	*scatter with WR_ave
scatterfit WR_ave demrep7, ci

*fold pid for intensity
gen pid7_str=.
replace pid7_str=4 if demrep7==1
replace pid7_str=3 if demrep7==2
replace pid7_str=2 if demrep7==3
replace pid7_str=1 if demrep7==4
replace pid7_str=2 if demrep7==5
replace pid7_str=3 if demrep7==6
replace pid7_str=4 if demrep7==7
label variable pid7_str "Partisan Strength" 
tab demrep7 pid7_str

*ideology (q13)
tab q13
gen libcon=q13
label variable libcon "Ideology (Lib-Con)"
tab q13 libcon
	*scatter with WR_ave
scatterfit WR_ave libcon, ci

*fold ideo for intensity
gen ideo_str=.
replace ideo_str=4 if libcon==1
replace ideo_str=3 if libcon==2
replace ideo_str=2 if libcon==3
replace ideo_str=1 if libcon==4
replace ideo_str=2 if libcon==5
replace ideo_str=3 if libcon==6
replace ideo_str=4 if libcon==7
label variable ideo_str "Ideological Strength"
tab libcon ideo_str

*flip I closely follow what's going on in government and current events (q40_2)
tab q40_2
gen followpol=.
replace followpol=1 if q40_2==5
replace followpol=2 if q40_2==4
replace followpol=3 if q40_2==3
replace followpol=4 if q40_2==2
replace followpol=5 if q40_2==1
label variable followpol "Follows Politics"
tab q40_2 followpol

*make the anti establishment scale
	*confirm there is a single dimension
factor ctscale_1 ctscale_2 ctscale_3 ctscale_4 antiest_1 antiest_2 antiest_3 antiest_4 antiest_5, pcf
	*flip Even though we live in a democracy, a few people will always run things anyway. (CTSCALE_1) 
gen few_people=.
replace few_people=1 if ctscale_1==5
replace few_people=2 if ctscale_1==4
replace few_people=3 if ctscale_1==3
replace few_people=4 if ctscale_1==2
replace few_people=5 if ctscale_1==1
tab ctscale_1 few_people
	*flip The people who really "run" the country, are not known to the voters. (CTSCALE_2) 
gen really_run=.
replace really_run=1 if ctscale_2==5
replace really_run=2 if ctscale_2==4
replace really_run=3 if ctscale_2==3
replace really_run=4 if ctscale_2==2
replace really_run=5 if ctscale_2==1
tab ctscale_2 really_run
	*flip Big events like wars, the recent recession... (CTSCALE_3)
gen big_events=.
replace big_events=1 if ctscale_3==5
replace big_events=2 if ctscale_3==4
replace big_events=3 if ctscale_3==3
replace big_events=4 if ctscale_3==2
replace big_events=5 if ctscale_3==1
tab ctscale_3 big_events
	*flip Much of our lives are being controlled by plots hatched in secret places. (CTSCALE_4) 
gen secret_plots=.
replace secret_plots=1 if ctscale_4==5
replace secret_plots=2 if ctscale_4==4
replace secret_plots=3 if ctscale_4==3
replace secret_plots=4 if ctscale_4==2
replace secret_plots=5 if ctscale_4==1
tab ctscale_4 secret_plots
	*flip Elected officials talk too much and take too little action. (ANTIEST_1) 
gen talk_much=.
replace	talk_much=1 if antiest_1==5
replace	talk_much=2 if antiest_1==4
replace	talk_much=3 if antiest_1==3
replace	talk_much=4 if antiest_1==2
replace	talk_much=5 if antiest_1==1
tab antiest_1 talk_much		
	*flip What people call "compromise" in politics is really just selling out on one's principles. (ANTIEST_2) 
gen sell_out=.
replace	sell_out=1 if antiest_2==5
replace	sell_out=2 if antiest_2==4
replace	sell_out=3 if antiest_2==3
replace	sell_out=4 if antiest_2==2
replace	sell_out=5 if antiest_2==1
tab antiest_2 sell_out
	*flip Established politicians who claim to defend our interests only take care of themselves (ANTIEST_3) 
gen estab_pols=.
replace	estab_pols=1 if antiest_3==5
replace	estab_pols=2 if antiest_3==4
replace	estab_pols=3 if antiest_3==3
replace	estab_pols=4 if antiest_3==2
replace	estab_pols=5 if antiest_3==1
tab antiest_3 estab_pols		
	*flip The established elite and politicians have often betrayed the people. (ANTIEST_4) 
gen betray_people=.
replace	betray_people=1 if antiest_4==5
replace	betray_people=2 if antiest_4==4
replace	betray_people=3 if antiest_4==3
replace	betray_people=4 if antiest_4==2
replace	betray_people=5 if antiest_4==1
tab antiest_4 betray_people
	*flip Politics is a battle between good and evil. (ANTIEST_5) 
gen good_evil=.
replace	good_evil=1 if antiest_5==5
replace	good_evil=2 if antiest_5==4
replace	good_evil=3 if antiest_5==3
replace	good_evil=4 if antiest_5==2
replace	good_evil=5 if antiest_5==1
tab antiest_5 good_evil		
	*combine
factor few_people really_run big_events secret_plots talk_much sell_out estab_pols betray_people good_evil, ipf
alpha few_people really_run big_events secret_plots talk_much sell_out estab_pols betray_people good_evil, gen(antiestab)
label variable antiestab "Anti-Establishment"
tab antiestab

*religion
	*flip importance of religion (q14)
tab q14
gen relig_imp=.
replace relig_imp=1 if q14==4
replace relig_imp=2 if q14==3
replace relig_imp=3 if q14==2
replace relig_imp=4 if q14==1
tab q14 relig_imp
	*flip rate of attendence (note: data are missing, but no DKs selected)
tab q15
gen relig_freq=.
replace relig_freq=1 if q15==6
replace relig_freq=2 if q15==5
replace relig_freq=3 if q15==4
replace relig_freq=4 if q15==3
replace relig_freq=5 if q15==2
replace relig_freq=6 if q15==1
tab q15 relig_freq
	*flip frequency of prayer (code n = 36 dk as 1)
tab q16
gen freq_prayer=.
replace freq_prayer=1 if q16==8
replace freq_prayer=1 if q16==7
replace freq_prayer=2 if q16==6
replace freq_prayer=3 if q16==5
replace freq_prayer=4 if q16==4
replace freq_prayer=5 if q16==3
replace freq_prayer=6 if q16==2
replace freq_prayer=7 if q16==1
tab q16 freq_prayer
	*combine
		*make all 0-1 since on diff scales (NOTE: this rescales the vars, so re-run the recodes if you want original scales)
foreach var of varlist relig_imp relig_freq freq_prayer ///
{
		qui sum `var'
		replace `var' = (`var' - `r(min)') / (`r(max)'-`r(min)')
	}		
			*check the above
sum relig_imp relig_freq freq_prayer
		*factor and make index
factor relig_imp relig_freq freq_prayer, ipf
alpha relig_imp relig_freq freq_prayer, gen(religiosity)
label variable religiosity "Religiosity"
tab religiosity

*flip: The government can be trusted. (Q45_2)
recode q45_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(govtrust)		
label variable govtrust "Trust in Government"
tab q45_2 govtrust

*need for chaos
	*flip I fantasize about a natural disaster wiping out most of humanity such that a small group of people can start all over. (Q46_1) 
tab q46_1
gen q46_1_flip=.
replace q46_1_flip=1 if q46_1==5
replace q46_1_flip=2 if q46_1==4
replace q46_1_flip=3 if q46_1==3
replace q46_1_flip=4 if q46_1==2
replace q46_1_flip=5 if q46_1==1
tab q46_1 q46_1_flip
	*flip I think society should be burned to the ground. (Q46_2) 
tab q46_2
gen q46_2_flip=.
replace q46_2_flip=1 if q46_2==5
replace q46_2_flip=2 if q46_2==4
replace q46_2_flip=3 if q46_2==3
replace q46_2_flip=4 if q46_2==2
replace q46_2_flip=5 if q46_2==1
tab q46_2 q46_2_flip
	*flip When I think about our political institutions, I cannot help thinking "just let them all burn." (Q46_3) 
tab q46_3
gen q46_3_flip=.
replace q46_3_flip=1 if q46_3==5
replace q46_3_flip=2 if q46_3==4
replace q46_3_flip=3 if q46_3==3
replace q46_3_flip=4 if q46_3==2
replace q46_3_flip=5 if q46_3==1
tab q46_3 q46_3_flip	
	*flip We cannot fix the problems in our society, we need to tear it down and start over. (Q46_4) 
tab q46_4
gen q46_4_flip=.
replace q46_4_flip=1 if q46_4==5
replace q46_4_flip=2 if q46_4==4
replace q46_4_flip=3 if q46_4==3
replace q46_4_flip=4 if q46_4==2
replace q46_4_flip=5 if q46_4==1
tab q46_4 q46_4_flip
	*flip I need chaos around me - it is too boring if nothing is going on. (Q46_5) 
tab q46_5
gen q46_5_flip=.
replace q46_5_flip=1 if q46_5==5
replace q46_5_flip=2 if q46_5==4
replace q46_5_flip=3 if q46_5==3
replace q46_5_flip=4 if q46_5==2
replace q46_5_flip=5 if q46_5==1
tab q46_5 q46_5_flip
	*flip Sometimes I just feel like destroying beautiful things. (Q46_6) 
tab q46_6
gen q46_6_flip=.
replace q46_6_flip=1 if q46_6==5
replace q46_6_flip=2 if q46_6==4
replace q46_6_flip=3 if q46_6==3
replace q46_6_flip=4 if q46_6==2
replace q46_6_flip=5 if q46_6==1
tab q46_6 q46_6_flip
	*combine
factor q46_1_flip q46_2_flip q46_3_flip q46_4_flip q46_5_flip q46_6_flip, ipf
alpha q46_1_flip q46_2_flip q46_3_flip q46_4_flip q46_5_flip q46_6_flip, gen(need4chaos)
label variable need4chaos "Need for Chaos"
tab need4chaos
	
*dark tetrad
	*flip I tend to manipulate others to get my way. (MACH_1) 
gen mach1=.
replace mach1=1 if mach_1==5
replace mach1=2 if mach_1==4
replace mach1=3 if mach_1==3
replace mach1=4 if mach_1==2
replace mach1=5 if mach_1==1
tab mach_1 mach1
	*flip I have used deceit or lied to get my way. (MACH_2) 
gen mach2=.
replace mach2=1 if mach_2==5
replace mach2=2 if mach_2==4
replace mach2=3 if mach_2==3
replace mach2=4 if mach_2==2
replace mach2=5 if mach_2==1
tab mach_2 mach2
	*flip I have used flattery to get my way. (MACH_3) 
gen mach3=.
replace mach3=1 if mach_3==5
replace mach3=2 if mach_3==4
replace mach3=3 if mach_3==3
replace mach3=4 if mach_3==2
replace mach3=5 if mach_3==1
tab mach_3 mach3
	*flip I tend to exploit others towards my own end. (MACH_4) 
gen mach4=.
replace mach4=1 if mach_4==5
replace mach4=2 if mach_4==4
replace mach4=3 if mach_4==3
replace mach4=4 if mach_4==2
replace mach4=5 if mach_4==1
tab mach_4 mach4
	*flip I tend to want others to admire me. (NARC_1) 
gen narc1=.
replace narc1=1 if narc_1==5
replace narc1=2 if narc_1==4
replace narc1=3 if narc_1==3
replace narc1=4 if narc_1==2
replace narc1=5 if narc_1==1
tab narc_1 narc1
	*flip I tend to want others to pay attention to me. (NARC_2) 
gen narc2=.
replace narc2=1 if narc_2==5
replace narc2=2 if narc_2==4
replace narc2=3 if narc_2==3
replace narc2=4 if narc_2==2
replace narc2=5 if narc_2==1
tab narc_2 narc2		
	*flip I tend to seek prestige or status. (NARC_3) 
gen narc3=.
replace narc3=1 if narc_3==5
replace narc3=2 if narc_3==4
replace narc3=3 if narc_3==3
replace narc3=4 if narc_3==2
replace narc3=5 if narc_3==1
tab narc_3 narc3
	*flip I tend to expect special favors from others. (NARC_4) 
gen narc4=.
replace narc4=1 if narc_4==5
replace narc4=2 if narc_4==4
replace narc4=3 if narc_4==3
replace narc4=4 if narc_4==2
replace narc4=5 if narc_4==1
tab narc_4 narc4
	*flip I tend to lack remorse. (PSYC_1) 
gen psyc1=.
replace psyc1=1 if psyc_1==5
replace psyc1=2 if psyc_1==4
replace psyc1=3 if psyc_1==3
replace psyc1=4 if psyc_1==2
replace psyc1=5 if psyc_1==1
tab psyc_1 psyc1
	*flip I tend to be unconcerned with the morality of my actions. (PSYC_2) 
gen psyc2=.
replace psyc2=1 if psyc_2==5
replace psyc2=2 if psyc_2==4
replace psyc2=3 if psyc_2==3
replace psyc2=4 if psyc_2==2
replace psyc2=5 if psyc_2==1
tab psyc_2 psyc2
	*flip I tend to be callous or insensitive. (PSYC_3) 
gen psyc3=.
replace psyc3=1 if psyc_3==5
replace psyc3=2 if psyc_3==4
replace psyc3=3 if psyc_3==3
replace psyc3=4 if psyc_3==2
replace psyc3=5 if psyc_3==1
tab psyc_3 psyc3
	*flip I tend to be cynical. (PSYC_4) 
gen psyc4=.
replace psyc4=1 if psyc_4==5
replace psyc4=2 if psyc_4==4
replace psyc4=3 if psyc_4==3
replace psyc4=4 if psyc_4==2
replace psyc4=5 if psyc_4==1
tab psyc_4 psyc4
	*flip It's funny when idiots fall flat on their face. (SADISM_1) 
recode sadism_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism1)
tab sadism_1 sadism1
	*flip Some people deserve to suffer. (SADISM_2) 
recode sadism_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism2)
tab sadism_2 sadism2
	*flip Just for kicks, I've said mean things on social media. (SADISM_3) 
recode sadism_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism3)
tab sadism_3 sadism3	
	*flip I know how to hurt someone with words alone. (SADISM_4) 
recode sadism_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sadism4)
tab sadism_4 sadism4
	*combine
factor mach1-mach4 narc1-narc4 psyc1-psyc4 sadism1-sadism4, ipf
alpha mach1-mach4 narc1-narc4 psyc1-psyc4, gen(darktetrad)
label variable darktetrad "Dark Tetrad"
tab darktetrad

*legacy news media (q95 series)
	*flip Network TV news (q95_1)
gen q95_1_flip=.
replace q95_1_flip=1 if q95_1==5
replace q95_1_flip=2 if q95_1==4
replace q95_1_flip=3 if q95_1==3
replace q95_1_flip=4 if q95_1==2
replace q95_1_flip=5 if q95_1==1
tab q95_1 q95_1_flip	
	*flip Cable TV news (q95_2) 
gen q95_2_flip=.
replace q95_2_flip=1 if q95_2==5
replace q95_2_flip=2 if q95_2==4
replace q95_2_flip=3 if q95_2==3
replace q95_2_flip=4 if q95_2==2
replace q95_2_flip=5 if q95_2==1
tab q95_2 q95_2_flip	
	*flip Local TV news (q95_3) 
gen q95_3_flip=.
replace q95_3_flip=1 if q95_3==5
replace q95_3_flip=2 if q95_3==4
replace q95_3_flip=3 if q95_3==3
replace q95_3_flip=4 if q95_3==2
replace q95_3_flip=5 if q95_3==1
tab q95_3 q95_3_flip	
	*flip Print newspapers (q95_4) 
gen q95_4_flip=.
replace q95_4_flip=1 if q95_4==5
replace q95_4_flip=2 if q95_4==4
replace q95_4_flip=3 if q95_4==3
replace q95_4_flip=4 if q95_4==2
replace q95_4_flip=5 if q95_4==1
tab q95_4 q95_4_flip	
	*flip Radio (q95_5) 
gen q95_5_flip=.
replace q95_5_flip=1 if q95_5==5
replace q95_5_flip=2 if q95_5==4
replace q95_5_flip=3 if q95_5==3
replace q95_5_flip=4 if q95_5==2
replace q95_5_flip=5 if q95_5==1
tab q95_5 q95_5_flip
	*combine into summary index
factor q95_1_flip q95_2_flip q95_3_flip q95_4_flip q95_5_flip, ipf
alpha q95_1_flip q95_2_flip q95_3_flip q95_4_flip q95_5_flip, gen(leg_media)
label variable leg_media "Legacy News Media Use" 
tab leg_media

*new news media (q96 series)
	*look for dimensions (note: PC1 explains 70% of variance)
factor q96_1 q96_2 q96_3 q96_4 q96_5 q96_6 q96_7 q96_8 q96_9 q96_10 q96_11 q96_12, ipf
	*flip Online newspapers (Q96_1) 
gen q96_1_flip=.
replace q96_1_flip=1 if q96_1==5
replace q96_1_flip=2 if q96_1==4
replace q96_1_flip=3 if q96_1==3
replace q96_1_flip=4 if q96_1==2
replace q96_1_flip=5 if q96_1==1
tab q96_1 q96_1_flip	
	*flip Online news magazines (Q96_2) 
gen q96_2_flip=.
replace q96_2_flip=1 if q96_2==5
replace q96_2_flip=2 if q96_2==4
replace q96_2_flip=3 if q96_2==3
replace q96_2_flip=4 if q96_2==2
replace q96_2_flip=5 if q96_2==1
tab q96_2 q96_2_flip	
	*flip Blogs (Q96_3) 
gen q96_3_flip=.
replace q96_3_flip=1 if q96_3==5
replace q96_3_flip=2 if q96_3==4
replace q96_3_flip=3 if q96_3==3
replace q96_3_flip=4 if q96_3==2
replace q96_3_flip=5 if q96_3==1
tab q96_3 q96_3_flip
	*flip YouTube (Q96_4) 
gen q96_4_flip=.
replace q96_4_flip=1 if q96_4==5
replace q96_4_flip=2 if q96_4==4
replace q96_4_flip=3 if q96_4==3
replace q96_4_flip=4 if q96_4==2
replace q96_4_flip=5 if q96_4==1
tab q96_4 q96_4_flip
	*flip Facebook (Q96_5) 
gen q96_5_flip=.
replace q96_5_flip=1 if q96_5==5
replace q96_5_flip=2 if q96_5==4
replace q96_5_flip=3 if q96_5==3
replace q96_5_flip=4 if q96_5==2
replace q96_5_flip=5 if q96_5==1
tab q96_5 q96_5_flip
	*flip Twitter (Q96_6) 
gen q96_6_flip=.
replace q96_6_flip=1 if q96_6==5
replace q96_6_flip=2 if q96_6==4
replace q96_6_flip=3 if q96_6==3
replace q96_6_flip=4 if q96_6==2
replace q96_6_flip=5 if q96_6==1
tab q96_6 q96_6_flip	
	*flip Reddit (Q96_7) 
gen q96_7_flip=.
replace q96_7_flip=1 if q96_7==5
replace q96_7_flip=2 if q96_7==4
replace q96_7_flip=3 if q96_7==3
replace q96_7_flip=4 if q96_7==2
replace q96_7_flip=5 if q96_7==1
tab q96_7 q96_7_flip
	*flip Instagram (Q96_8) 
gen q96_8_flip=.
replace q96_8_flip=1 if q96_8==5
replace q96_8_flip=2 if q96_8==4
replace q96_8_flip=3 if q96_8==3
replace q96_8_flip=4 if q96_8==2
replace q96_8_flip=5 if q96_8==1
tab q96_8 q96_8_flip
	*flip TV news websites (e.g., CNN.com, FoxNews.com) (Q96_9) 
gen q96_9_flip=.
replace q96_9_flip=1 if q96_9==5
replace q96_9_flip=2 if q96_9==4
replace q96_9_flip=3 if q96_9==3
replace q96_9_flip=4 if q96_9==2
replace q96_9_flip=5 if q96_9==1
tab q96_9 q96_9_flip
	*flip 8Kun (Q96_10) 
gen q96_10_flip=.
replace q96_10_flip=1 if q96_10==5
replace q96_10_flip=2 if q96_10==4
replace q96_10_flip=3 if q96_10==3
replace q96_10_flip=4 if q96_10==2
replace q96_10_flip=5 if q96_10==1
tab q96_10 q96_10_flip	
	*flip Telegram (Q96_11) 
gen q96_11_flip=.
replace q96_11_flip=1 if q96_11==5
replace q96_11_flip=2 if q96_11==4
replace q96_11_flip=3 if q96_11==3
replace q96_11_flip=4 if q96_11==2
replace q96_11_flip=5 if q96_11==1
tab q96_11 q96_11_flip
	*flip Truth Social (Q96_12) 
gen q96_12_flip=.
replace q96_12_flip=1 if q96_12==5
replace q96_12_flip=2 if q96_12==4
replace q96_12_flip=3 if q96_12==3
replace q96_12_flip=4 if q96_12==2
replace q96_12_flip=5 if q96_12==1
tab q96_12 q96_12_flip
	*combine into summary index
factor q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_7_flip q96_8_flip q96_9_flip q96_10_flip q96_11_flip q96_12_flip, ipf
alpha q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_7_flip q96_8_flip q96_9_flip q96_10_flip q96_11_flip q96_12_flip, gen(new_media)
label variable new_media "Online News Media Use" 
tab new_media

*new news media (q96 series): NOW SPLIT THIS INTO MAINSTREAM AND FRINGE
	*mainstream	(online newspapers; Online news magazines; blogs; youtube: facebook; twitter; insta; TV news websites); eigen = 3.46, prop = .72; alpha = .84
factor q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_8_flip q96_9_flip, ipf
alpha q96_1_flip q96_2_flip q96_3_flip q96_4_flip q96_5_flip q96_6_flip q96_8_flip q96_9_flip, gen(new_media_main)
label variable new_media_main "Online News Media, Mainstream"
tab new_media_main
	*fringe (reddit; 8kun; telegram; truth social); eigen = 2.44, prop = .95, alpha = .84
factor q96_7_flip q96_10_flip q96_11_flip q96_12_flip, ipf
alpha q96_7_flip q96_10_flip q96_11_flip q96_12_flip, gen(new_media_fringe)
label variable new_media_fringe "Online News Media, Fringe"
tab new_media_fringe

*Christian nationalism (q48 series)
	*flip The federal government should declare the United States a Christian nation. (Q48_1) 
gen q48_1_flip=.
replace q48_1_flip=1 if q48_1==5
replace q48_1_flip=2 if q48_1==4
replace q48_1_flip=3 if q48_1==3
replace q48_1_flip=4 if q48_1==2
replace q48_1_flip=5 if q48_1==1
tab q48_1 q48_1_flip
	*flip The federal government should advocate Christian values. (Q48_2) 
gen q48_2_flip=.
replace q48_2_flip=1 if q48_2==5
replace q48_2_flip=2 if q48_2==4
replace q48_2_flip=3 if q48_2==3
replace q48_2_flip=4 if q48_2==2
replace q48_2_flip=5 if q48_2==1
tab q48_2 q48_2_flip	
	*flip The federal government should enforce strict separation of church and state. (Q48_3) 
		*DO NOT FLIP
	*flip The success of the United States is part of God's plan. (Q48_4) 
gen q48_4_flip=.
replace q48_4_flip=1 if q48_4==5
replace q48_4_flip=2 if q48_4==4
replace q48_4_flip=3 if q48_4==3
replace q48_4_flip=4 if q48_4==2
replace q48_4_flip=5 if q48_4==1
tab q48_4 q48_4_flip
	*flip The federal government should allow prayer in public schools. (Q48_5) 
gen q48_5_flip=.
replace q48_5_flip=1 if q48_5==5
replace q48_5_flip=2 if q48_5==4
replace q48_5_flip=3 if q48_5==3
replace q48_5_flip=4 if q48_5==2
replace q48_5_flip=5 if q48_5==1
tab q48_5 q48_5_flip
	*combine into summary index
factor q48_1_flip q48_2_flip q48_3 q48_4_flip q48_5_flip, ipf
alpha q48_1_flip q48_2_flip q48_3 q48_4_flip q48_5_flip, gen(christ_nat)
label variable christ_nat "Christian Nationalism" 
tab christ_nat	

*paranoia (q74 series)
	*flip Certain people have it in for me. (Q74_1) 
gen q74_1_flip=.
replace q74_1_flip=1 if q74_1==5
replace q74_1_flip=2 if q74_1==4
replace q74_1_flip=3 if q74_1==3
replace q74_1_flip=4 if q74_1==2
replace q74_1_flip=5 if q74_1==1
tab q74_1 q74_1_flip
	*flip There is a conspiracy against me. (Q74_2) 
gen q74_2_flip=.
replace q74_2_flip=1 if q74_2==5
replace q74_2_flip=2 if q74_2==4
replace q74_2_flip=3 if q74_2==3
replace q74_2_flip=4 if q74_2==2
replace q74_2_flip=5 if q74_2==1
tab q74_2 q74_2_flip
	*flip People are persecuting me. (Q74_3) 
gen q74_3_flip=.
replace q74_3_flip=1 if q74_3==5
replace q74_3_flip=2 if q74_3==4
replace q74_3_flip=3 if q74_3==3
replace q74_3_flip=4 if q74_3==2
replace q74_3_flip=5 if q74_3==1
tab q74_3 q74_3_flip
	*combine into summary index
factor q74_1_flip q74_2_flip q74_3_flip, ipf
alpha q74_1_flip q74_2_flip q74_3_flip, gen(paranoia)
label variable paranoia "Paranoia" 
tab paranoia		

*Knowledge, Q85 correct answers of 1-6 make a scale (sclit series)
	*code 1= correct, 0 = incorrect
recode scilit_1 (1=0) (2=1), gen(sciknow1)
tab scilit_1 sciknow1
recode scilit_2 (1=1) (2=0), gen(sciknow2)
tab scilit_2 sciknow2
recode scilit_3 (1=0) (2=1), gen(sciknow3)
tab scilit_3 sciknow3
recode scilit_4 (1=0) (2=1), gen(sciknow4)
tab scilit_4 sciknow4
recode scilit_5 (1=1) (2=0), gen(sciknow5)
tab scilit_5 sciknow5
recode scilit_6 (1=1) (2=0), gen(sciknow6)
tab scilit_6 sciknow6
	*combine into a count of correct responses
gen sci_lit=sciknow1+sciknow2+sciknow3+sciknow4+sciknow5+sciknow6
tab sci_lit
	*label
label variable sci_lit "Scientific Literacy"

*Anti-Intellectualism, Q86 1-7 (not with 8 and 9), make a scale; coded hi-low on trust so no flip
	*reduce (alpha = 0.9152)
factor trust_exp trust_eco trust_sci trust_doc trust_leg trust_prf trust_fin, ipf
alpha trust_exp trust_eco trust_sci trust_doc trust_leg trust_prf trust_fin, gen(anti_intel)
tab anti_intel
	*label
label variable anti_intel "Anti-Intellectualism"

*Q84 I have confidence in the scientific community.
	*flip
recode q84 (1=5) (2=4) (3=3) (4=2) (5=1), gen(sci_conf)
tab q84 sci_conf
	*label
label variable sci_conf "Confidence in Sci. Community"

*RW Authoritarianism, Q43 series
	*flip: God's laws about abortion, pornography, and marriage must be strictly followed before it is too late. (Q43_1) 
recode q43_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_1_flip)
tab q43_1 q43_1_flip
	*keep as-is: There is nothing wrong with premarital sexual intercourse. (Q43_2) 
	*flip: Our society needs stricter laws. (Q43_3) 
recode q43_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_3_flip)
tab q43_3 q43_3_flip
	*flip: Crime and the recent public disorders show that we have to crack down harder on troublemakers, if we are going preserve law and order. (Q43_4) 
recode q43_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q43_4_flip)
tab q43_4 q43_4_flip	
	*reduce (alpha =  0.6642)
factor q43_1_flip q43_2 q43_3_flip q43_4_flip, ipf
alpha q43_1_flip q43_2 q43_3_flip q43_4_flip, gen(rw_auth)
tab rw_auth
	*label
label variable rw_auth "Right-Wing Authoritarianism"

*LW Authoritarianism, Q42
	*flip: The rich should be stripped of their belongings and status. (Q42_1) 
recode q42_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_1_flip)
tab q42_1 q42_1_flip
	*flip: Rich people should be forced to give up most of their wealth. (Q42_2) 
recode q42_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_2_flip)
tab q42_2 q42_2_flip	
	*flip: If I could remake society, I would put people who currently have the most privilege at the very bottom. (Q42_3) 
recode q42_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q42_3_flip)
tab q42_3 q42_3_flip	
	*reduce
factor q42_1_flip q42_2_flip q42_3_flip, ipf
alpha q42_1_flip q42_2_flip q42_3_flip, gen (lw_auth)
tab lw_auth
	*label
label variable lw_auth "Left-Wing Authoritarianism"

*National Narcissism, Q59
	*flip all 3
recode q59_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_1_flip)
tab q59_1 q59_1_flip
recode q59_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_2_flip)
tab q59_2 q59_2_flip
recode q59_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q59_3_flip)
tab q59_3 q59_3_flip
	*reduce (alpha =  0.8006)
factor q59_1_flip q59_2_flip q59_3_flip, ipf
alpha q59_1_flip q59_2_flip q59_3_flip, gen (nat_narc)
tab nat_narc
	*label
label variable nat_narc "National Narcissism"

*Dogmatism, Q61
	*flip all 3
recode q61_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_1_flip)
tab q61_1 q61_1_flip
recode q61_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_2_flip)
tab q61_2 q61_2_flip
recode q61_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q61_3_flip)
tab q61_3 q61_3_flip
	*reduce (alpha =   0.6928)
factor q61_1_flip q61_2_flip q61_3_flip, ipf
alpha q61_1_flip q61_2_flip q61_3_flip, gen (dogmatic)
tab dogmatic
	*label
label variable dogmatic "Dogmatism"

*Gendered Nationalism, Q101
	*flip all 3
recode q101_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_1_flip)
tab q101_1 q101_1_flip
recode q101_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_2_flip)
tab q101_2 q101_2_flip
recode q101_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q101_3_flip)
tab q101_3 q101_3_flip
	*reduce (alpha =  0.8590)
factor q101_1_flip q101_2_flip q101_3_flip, ipf
alpha q101_1_flip q101_2_flip q101_3_flip, gen(gen_nat)
tab gen_nat
	*label
label variable gen_nat "Gendered Nationalism"

*Denialism, Q83 1-4 (not 5) scale
	*flip all 4
recode q83_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_1_flip)
tab q83_1 q83_1_flip
recode q83_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_2_flip)
tab q83_2 q83_2_flip
recode q83_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_3_flip)
tab q83_3 q83_3_flip
recode q83_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q83_4_flip)
tab q83_4 q83_4_flip
	*reduce (alpha =  0.8218)
factor q83_1_flip q83_2_flip q83_3_flip q83_4_flip, ipf
alpha q83_1_flip q83_2_flip q83_3_flip q83_4_flip, gen(denialism)
tab denialism
	*label
label variable denialism "Denialism"

*PANAS-GEN affect battery
	*positive: Interested (Q75_1); Excited (Q75_3); Strong (Q75_5); Enthusiastic (Q288_4);
	*Proud (Q288_5); Alert (Q289_2); Inspired (Q289_4); Determined (Q290_1); Attentive (Q290_2); Active (Q290_4)
		*reduce (alpha =  0.8395)
factor q75_1 q75_3 q75_5 q288_4 q288_5 q289_2 q289_4 q290_1 q290_2 q290_4, ipf
alpha q75_1 q75_3 q75_5 q288_4 q288_5 q289_2 q289_4 q290_1 q290_2 q290_4
gen pos_affect=q75_1+q75_3+q75_5+q288_4+q288_5+q289_2+q289_4+q290_1+q290_2+q290_4
tab pos_affect
		*label
label variable pos_affect "Positive Affect"
	*negative: Distressed (Q75_2); Upset (Q75_4); Guilty (Q288_1); Scared (Q288_2); Hostile (Q288_3) 
	*Irritable (Q289_1); Ashamed (Q289_3); Nervous (Q289_5); Jittery (Q290_3); Afraid (Q290_5) 
		*reduce (alpha =  0.8820)
factor q75_2 q75_4 q288_1 q288_2 q288_3 q289_1 q289_3 q289_5 q290_3 q290_5, ipf
alpha q75_2 q75_4 q288_1 q288_2 q288_3 q289_1 q289_3 q289_5 q290_3 q290_5
gen neg_affect=q75_2+q75_4+q288_1+q288_2+q288_3+q289_1+q289_3+q289_5+q290_3+q290_5
tab neg_affect
		*label
label variable neg_affect "Negative Affect"
	*correlate the two
pwcorr pos_affect neg_affect, sig

*racial resentment
	*Generations of slavery and discrimination have created conditions that make it difficult for blacks to work their way out of the lower class. (Q58_1) 
		*DO NOT FLIP
	*flip: It's really a matter of some people not trying hard enough; if blacks would only try harder they could be just as well off as whites. (Q58_2) 
recode q58_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q58_2_flip)	
tab q58_2 q58_2_flip	
	*Over the past few years, blacks have gotten less than they deserve. (Q58_3) 
		*DO NOT FLIP
	*flip: Irish, Italians, Jewish and many other minorities overcame prejudice and worked their way up. Blacks should do the same without any special favors. (Q58_4) 
recode q58_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q58_4_flip)	
tab q58_4 q58_4_flip
	*reduce (alpha = .78)
factor q58_1 q58_2_flip q58_3 q58_4_flip, ipf
alpha q58_1 q58_2_flip q58_3 q58_4_flip, gen(race_resent)
tab race_resent
	*label
label variable race_resent "Racial Resentment"	

*xenophobia
	*flip: Illegal immigrants increase crime in the US. (Q60_1) 
recode q60_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q60_1_flip)	
tab q60_1 q60_1_flip
	*flip: Illegal immigrants decrease wages for Americans. (Q60_2) 
recode q60_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q60_2_flip)	
tab q60_2 q60_2_flip
	*Immigrants contribute more in taxes than they receive in health and welfare services. (Q60_3) 
		*DO NOT FLIP
	*flip: Immigration in general should be slowed down. (Q60_4) 
recode q60_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q60_4_flip)	
tab q60_4 q60_4_flip
	*reduce (alpha = .75)
factor q60_1_flip q60_2_flip q60_3 q60_4_flip, ipf
alpha q60_1_flip q60_2_flip q60_3 q60_4_flip, gen(xenophobia)
tab xenophobia
	*label
label variable xenophobia "Anti-Immigrant Sentiment"

*male normativity (q71 series)
	*flip Men should be able to fix most things around the house. (Q71_1) 
gen q71_1_flip=.
replace q71_1_flip=1 if q71_1==5
replace q71_1_flip=2 if q71_1==4
replace q71_1_flip=3 if q71_1==3
replace q71_1_flip=4 if q71_1==2
replace q71_1_flip=5 if q71_1==1
tab q71_1 q71_1_flip
	*flip Men should always like to have sex. (Q71_2) 
gen q71_2_flip=.
replace q71_2_flip=1 if q71_2==5
replace q71_2_flip=2 if q71_2==4
replace q71_2_flip=3 if q71_2==3
replace q71_2_flip=4 if q71_2==2
replace q71_2_flip=5 if q71_2==1
tab q71_2 q71_2_flip
	*flip Homosexual men should never kiss in public. (Q71_3) 
gen q71_3_flip=.
replace q71_3_flip=1 if q71_3==5
replace q71_3_flip=2 if q71_3==4
replace q71_3_flip=3 if q71_3==3
replace q71_3_flip=4 if q71_3==2
replace q71_3_flip=5 if q71_3==1
tab q71_3 q71_3_flip
	*flip Boys should prefer to play with trucks rather than dolls. (Q71_4) 
gen q71_4_flip=.
replace q71_4_flip=1 if q71_4==5
replace q71_4_flip=2 if q71_4==4
replace q71_4_flip=3 if q71_4==3
replace q71_4_flip=4 if q71_4==2
replace q71_4_flip=5 if q71_4==1
tab q71_4 q71_4_flip
	*combine into summary index
factor q71_1_flip q71_2_flip q71_3_flip q71_4_flip, ipf
alpha q71_1_flip q71_2_flip q71_3_flip q71_4_flip, gen(male_norm)
label variable male_norm "Male Role Normativity" 
tab male_norm	

*Victimhood, Q56
	*flip
recode victim_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(victim_1_01)
tab victim_1 victim_1_01
recode victim_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(victim_2_01)
tab victim_2 victim_2_01
recode victim_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(victim_3_01)
tab victim_3 victim_3_01
recode victim_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(victim_4_01)
tab victim_4 victim_4_01
	*reduce (alpha = 0.8967)
factor victim_1_01 victim_2_01 victim_3_01 victim_4_01, ipf
alpha victim_1_01 victim_2_01 victim_3_01 victim_4_01, gen(victimhood)
	*label
label variable victimhood "Victimhood" 

*sexism q68
	*Women should earn the same wages as their male counterparts. (Q68_1) 
		*keep as-is
	*flip A woman's place is in the home. (Q68_2) 
recode q68_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q68_2_flip)		
	*flip The news media have been showing more concern about the treatment of women than is warranted by women's actual experiences. (Q68_3) 
recode q68_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q68_3_flip)	
	*flip Feminists are making unreasonable demands of men. (Q68_4) 
recode q68_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q68_4_flip)	
	*reduce (alpha =  0.6813)
factor q68_1 q68_2_flip q68_3_flip q68_4_flip, ipf
alpha q68_1 q68_2_flip q68_3_flip q68_4_flip, gen(sexism)
	*label
label variable sexism "Sexism"

****
****

*MODEL WR_ave

*descriptives all (report in SI)
estpost summarize WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, quietly
esttab using "WR_descritives.rtf", cells("count mean(fmt(2)) sd(fmt(2)) min max") replace

*correations for SI
pwcorr WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, sig
	*do the above again by just for white Rs
preserve
keep if white==1
pwcorr WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, sig
restore	

*model WR_ave to get VIF for SI
reg WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
vif
	*do the above again by just for white Rs
preserve
keep if white==1
reg WR_ave female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
vif
restore

*make a table for SI w/ WR_ave and the 3 constituent vars as DVs (NOT doing standardized here); HERE FOR ALL RESPONDENTS
	*WR_ave index
reg WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod1
	*WR_US
reg WR_US female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod2
	*WR_EURO flip White people in Europe are being replaced with cheaper non-white workers because that is what powerful politicians and corporate leaders want. (Q26_2) 
reg WR_EURO female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod3
	*WR_discrim
reg WR_discrim female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod4
	*make table
esttab mod1 mod2 mod3 mod4 using "WR_regtable_ALL_Rs.rtf", ///
	cells(b(star fmt(3)) se(par fmt(3))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(3 0 1)) ///
	replace
	
*make a table for SI w/ WR_ave and the 3 constituent vars as DVs (NOT doing standardized here); HERE FOR only WHITE ALL RESPONDENTS
preserve
keep if white==1
	*WR_ave index
reg WR_ave female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod1
	*WR_US
reg WR_US female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod2
	*WR_EURO flip White people in Europe are being replaced with cheaper non-white workers because that is what powerful politicians and corporate leaders want. (Q26_2) 
reg WR_EURO female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod3
	*WR_discrim
reg WR_discrim female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism
est store mod4
	*make table
esttab mod1 mod2 mod3 mod4 using "WR_regtable_onlywhite_Rs.rtf", ///
	cells(b(star fmt(3)) se(par fmt(3))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(3 0 1)) ///
	replace
restore

*make a table for SI w/ WR_ave and the 3 constituent vars as DVs (NOT doing standardized here); HERE FOR ALL RESPONDENTS and DROP ANTI-IMMIG SENTIMENT ("xenophobia")
	*WR_ave index
reg WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod1
	*WR_US
reg WR_US female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod2
	*WR_EURO flip White people in Europe are being replaced with cheaper non-white workers because that is what powerful politicians and corporate leaders want. (Q26_2) 
reg WR_EURO female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod3
	*WR_discrim
reg WR_discrim female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod4
	*make table
esttab mod1 mod2 mod3 mod4 using "WR_regtable_ALL_Rs_no_xenophobia.rtf", ///
	cells(b(star fmt(3)) se(par fmt(3))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(3 0 1)) ///
	replace
	
*make a table for SI w/ WR_ave and the 3 constituent vars as DVs (NOT doing standardized here); HERE FOR only WHITE ALL RESPONDENTS and DROP ANTI-IMMIG SENTIMENT ("xenophobia")
preserve
keep if white==1
	*WR_ave index
reg WR_ave female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod1
	*WR_US
reg WR_US female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod2
	*WR_EURO flip White people in Europe are being replaced with cheaper non-white workers because that is what powerful politicians and corporate leaders want. (Q26_2) 
reg WR_EURO female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod3
	*WR_discrim
reg WR_discrim female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent ///
male_norm victimhood sexism
est store mod4
	*make table
esttab mod1 mod2 mod3 mod4 using "WR_regtable_onlywhite_Rs_no_xenophobia.rtf", ///
	cells(b(star fmt(3)) se(par fmt(3))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(3 0 1)) ///
	replace
restore

*FIGURE 1
	*Panel A: all respondents
		*center the vars to make std coeffs in coefplot
preserve
center WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, inplace standardize
		*run model
reg WR_ave female white income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, noconstant		
		*plot 
coefplot, drop(_cons) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) sort(, descending) xtitle("standardized linear regression coefficient") graphregion(fcolor(white)) ylabel(,labsize(small)) xlabel(,labsize(small))
		*R2 decomp of the above
shapley2, stat(r2) group("need4chaos darktetrad paranoia dogmatic nat_narc victimhood rw_auth lw_auth pos_affect neg_affect, female white income educ age religiosity christ_nat, demrep7 libcon pid7_str ideo_st antiestab govtrust, leg_media new_media_main new_media_fringe followpol, anti_intel sci_conf denialism sci_lit, race_resent xenophobia male_norm gen_nat sexism")
restore

	*Panel B: just whites (here, moved out of appendix into main body of paper)
		*center the vars to make std coeffs in coefplot
preserve
keep if white==1
center WR_ave female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, inplace standardize
		*run model
reg WR_ave female income educ age ///
religiosity christ_nat ///
demrep7 libcon pid7_str ideo_st ///
govtrust antiestab ///
need4chaos darktetrad paranoia nat_narc rw_auth lw_auth dogmatic ///
gen_nat ///
pos_affect neg_affect ///
followpol leg_media new_media_main new_media_fringe ///
sci_lit anti_intel sci_conf denialism ///
race_resent xenophobia ///
male_norm victimhood sexism, noconstant		
		*plot 
coefplot, drop(_cons) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) sort(, descending) xtitle("standardized linear regression coefficient") graphregion(fcolor(white)) ylabel(,labsize(small)) xlabel(,labsize(small))
		*R2 decomp of the above
shapley2, stat(r2) group("need4chaos darktetrad paranoia dogmatic nat_narc victimhood rw_auth lw_auth pos_affect neg_affect, female income educ age religiosity christ_nat, demrep7 libcon pid7_str ideo_st antiestab govtrust, leg_media new_media_main new_media_fringe followpol, anti_intel sci_conf denialism sci_lit, race_resent xenophobia male_norm gen_nat sexism")
restore
		
****
****

*BELIEFS CORRELATED w/ WR (Figure 2)
 
*flip Russian President Vladimir Putin did the right thing by invading Ukraine. (Q22_1) 
recode q22_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_1_flip)	
tab q22_1 q22_1_flip

*flip The Russian invasion of Ukraine is largely the fault of U.S. policies. (Q22_2) 
recode q22_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_2_flip)	
tab q22_2 q22_2_flip

*leave as-is: FT Vladimir Putin (q37_22)

*flip The United States should aid Ukraine against Russia. (Q22_3) 
recode q22_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q22_3_flip)	
tab q22_3 q22_3_flip

*Roe v. Wade should be overturned? (Q285)
tab q285
	*make 1 = yes, 0 = no or "not sure"
gen end_roe=.
replace end_roe=1 if q285==1
replace end_roe=0 if q285==2
replace end_roe=0 if q285==3
label variable end_roe "Overturn Roe"
tab q285 end_roe

*belief on number of children being trafficked (q100)
tab q100
	*for appendix: look at how each category on this var relates to the DV
label define q100_label 6 "dk" 5 "much less" 4 "less" 3 "around 300k" 2 "higher" 1 "much higher"
label values q100 q100_label
label variable q100 "Est. of Child Trafficking"
anova WR_ave q100
margins q100
marginsplot
	*above suggests flip scale to run dk - much higher
	*flip
gen num_traff=.
replace num_traff=6 if q100==1
replace num_traff=5 if q100==2
replace num_traff=4 if q100==3
replace num_traff=3 if q100==4
replace num_traff=2 if q100==5
replace num_traff=1 if q100==6
tab q100 num_traff
label define traff_label 1 "dk" 2 "much less" 3 "less" 4 "around 300k" 5 "higher" 6 "much higher"
label variable num_traff "Est. of Child Trafficking (low-high)"
label values num_traff traff_label
anova WR_ave num_traff
margins num_traff
marginsplot

*leave as-is: Proud Boys (q287_18)
*leave as-is: White Nationalists (q287_19)
*leave as-is: Antifa (q287_20)
*leave as-is: FT Donald Trump (q37_4)
*leave as-is: FT Joe Biden (q37_15)
	
*flip Climate change is a hoax perpetrated by corrupt scientists and politicians. (Q18_1) 
recode q18_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q18_1_flip)	
tab q18_1 q18_1_flip

*leave as-is: q287_17 (qanon FT)

*flip There is a secret "gay agenda" aimed at converting young people into gay and trans lifestyles. (q283_3) 
recode q283_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q283_3_flip)	
tab q283_3 q283_3_flip	

*flip There is a secret agenda in the public schools to indoctrinate children into gay and trans lifestyles. (q17_7) 
recode q17_7 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_7_flip)	
tab q17_7 q17_7_flip	

*flip The threat of COVID-19 has been exaggerated for political purposes. (COVCONS_1) 
recode covcons_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_1_flip)	
tab covcons_1 covcons_1_flip		

*flip Coronavirus was purposely created and released. (COVCONS_2) 
recode covcons_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_2_flip)	
tab covcons_2 covcons_2_flip	

*flip The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3) 
recode covcons_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_3_flip)	
tab covcons_3 covcons_3_flip		

*flip The COVID-19 virus was engineered in a lab in China. (COVCONS_4) 
recode covcons_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(covcons_4_flip)	
tab covcons_4 covcons_4_flip	

*flip The COVID-19 vaccine causes infertility in women and the government is covering this up. (q283_1) 
recode q283_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q283_1_flip)	
tab q283_1 q283_1_flip	

*flip The dangers of vaccines are being hidden by the medical establishment. (q17_3) 
recode q17_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_3_flip)	
tab q17_3 q17_3_flip	

*flip The dangers of genetically-modified foods are being hidden from the public. (q17_4) 
recode q17_4 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_4_flip)	
tab q17_4 q17_4_flip	

*flip Corporations secretly poison our food. (q284_1) 
recode q284_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q284_1_flip)	
tab q284_1 q284_1_flip		

*flip The number of Jews killed by the Nazis during World War II has been exaggerated on purpose. (q17_2) 
recode q17_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q17_2_flip)	
tab q17_2 q17_2_flip	

*keep as-is: Bernie Sanders FT (q37_16)

*flip Barack Obama faked his citizenship to become president. (Q18_2) 
recode q18_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q18_2_flip)	
tab q18_2 q18_2_flip

*flip There is a "deep state" embedded in the government that operates in secret and without oversight. (Q20_2) 
recode q20_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q20_2_flip)	
tab q20_2 q20_2_flip

*flip Elites, from government and Hollywood, are engaged in a massive child sex trafficking racket. (Q20_3) 
recode q20_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q20_3_flip)	
tab q20_3 q20_3_flip

*as-is progressives FT (q287_21)

*as-is DEM party FT (q37_1)

*as-is REP party FT (q37_3)

*all respondents: run corr analyses (use "ci2" to get the ci's)
ci2 WR_ave q25_2_flip, corr
ci2 WR_ave q25_1_flip, corr
ci2 WR_ave q22_1_flip, corr
ci2 WR_ave q22_2_flip, corr
ci2 WR_ave q37_22, corr
ci2 WR_ave q22_3_flip, corr
ci2 WR_ave end_roe, corr
ci2 WR_ave num_traff, corr
ci2 WR_ave q287_18, corr
ci2 WR_ave q287_19, corr
ci2 WR_ave q287_20, corr
ci2 WR_ave q37_4, corr
ci2 WR_ave q37_15, corr
ci2 WR_ave q18_1_flip, corr
ci2 WR_ave q287_17, corr
ci2 WR_ave q283_3_flip, corr	
ci2 WR_ave q17_7_flip, corr	
ci2 WR_ave covcons_1_flip, corr		
ci2 WR_ave covcons_2_flip, corr	
ci2 WR_ave covcons_3_flip, corr		
ci2 WR_ave covcons_4_flip, corr	
ci2 WR_ave q283_1_flip, corr	
ci2 WR_ave q17_3_flip, corr	
ci2 WR_ave q17_4_flip, corr	
ci2 WR_ave q284_1_flip, corr		
ci2 WR_ave q17_2_flip, corr	
ci2 WR_ave q37_16, corr
ci2 WR_ave q18_2_flip, corr
ci2 WR_ave q20_2_flip, corr
ci2 WR_ave q20_3_flip, corr
ci2 WR_ave q287_21, corr
ci2 WR_ave q37_1, corr
ci2 WR_ave q37_3, corr

*only white respondents: run corr analyses (use "ci2" to get the ci's)
preserve
keep if white==1
ci2 WR_ave q25_2_flip, corr
ci2 WR_ave q25_1_flip, corr
ci2 WR_ave q22_1_flip, corr
ci2 WR_ave q22_2_flip, corr
ci2 WR_ave q37_22, corr
ci2 WR_ave q22_3_flip, corr
ci2 WR_ave end_roe, corr
ci2 WR_ave num_traff, corr
ci2 WR_ave q287_18, corr
ci2 WR_ave q287_19, corr
ci2 WR_ave q287_20, corr
ci2 WR_ave q37_4, corr
ci2 WR_ave q37_15, corr
ci2 WR_ave q18_1_flip, corr
ci2 WR_ave q287_17, corr
ci2 WR_ave q283_3_flip, corr	
ci2 WR_ave q17_7_flip, corr	
ci2 WR_ave covcons_1_flip, corr		
ci2 WR_ave covcons_2_flip, corr	
ci2 WR_ave covcons_3_flip, corr		
ci2 WR_ave covcons_4_flip, corr	
ci2 WR_ave q283_1_flip, corr	
ci2 WR_ave q17_3_flip, corr	
ci2 WR_ave q17_4_flip, corr	
ci2 WR_ave q284_1_flip, corr		
ci2 WR_ave q17_2_flip, corr	
ci2 WR_ave q37_16, corr
ci2 WR_ave q18_2_flip, corr
ci2 WR_ave q20_2_flip, corr
ci2 WR_ave q20_3_flip, corr
ci2 WR_ave q287_21, corr
ci2 WR_ave q37_1, corr
ci2 WR_ave q37_3, corr
restore

****
****

*CORRELATE WR w/ BEHAVIORS (Figure 3)

*If violence is called for in our politics, I am ready. (Q99_3) 
recode q99_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_3_flip)	
tab q99_3 q99_3_flip

*Violence is sometimes an acceptable way for Americans to express their disagreement with the government. (Q99_1) 
recode q99_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_1_flip)	
tab q99_1 q99_1_flip

*If needed to reach important objectives, the use of violence is acceptable. (Q99_2) 
recode q99_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q99_2_flip)	
tab q99_2 q99_2_flip

*leave as-is (scored lo-hi): Committed violence for a political cause (Q39_6)

*flip Q94 I share information on social media about politics even though I believe it may be false. 
tab q94
gen share_false=.
replace share_false=1 if q94==5
replace share_false=2 if q94==4
replace share_false=3 if q94==3
replace share_false=4 if q94==2
replace share_false=5 if q94==1
label variable share_false "Shares False Info Online"
tab q94 share_false

*make enjoyes arguing
	*flip I like to argue online with other people. (Q49_1) 
recode q49_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_1_flip)	
tab q49_1 q49_1_flip
	*flip I enjoy a good argument over a controversial issue. (Q49_2) 
recode q49_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_2_flip)	
tab q49_2 q49_2_flip
	*flip I am willing to express my opinion online even if others strongly disagree with me. (Q49_3) 
recode q49_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q49_3_flip)	
tab q49_3 q49_3_flip
	*combine vars into summary index (alpha =  0.7439)
pwcorr q49_1_flip q49_2_flip q49_3_flip, sig
factor q49_1_flip q49_2_flip q49_3_flip, ipf
alpha q49_1_flip q49_2_flip q49_3_flip, gen(enjoy_argue)	
summarize enjoy_argue
	
*interpersonal conflict (q50/CONFLICT_ series)
	*make them all 0 = no, 1 = yes (drop the first 3 in the battery to fix the scale)
recode conflict_3 (1=1) (2=0), gen(con_3_01)
recode conflict_4 (1=1) (2=0), gen(con_4_01)
recode conflict_5 (1=1) (2=0), gen(con_5_01)
recode conflict_6 (1=1) (2=0), gen(con_6_01)
recode conflict_7 (1=1) (2=0), gen(con_7_01)
recode conflict_8 (1=1) (2=0), gen(con_8_01)
	*look at latent structure	
factor con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01, ipf
alpha con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01
	*make a count of the things they do
egen conflict = rowtotal(con_3_01 con_4_01 con_5_01 con_6_01 con_7_01 con_8_01)
tab conflict
	
*make online political posting
	*Post links to political stories or articles for others to read. (Q92_1) 
recode q92_1 (1=1) (2=0), gen(q92_1_01)	
tab q92_1 q92_1_01
	*Repost content about political or social issues originally posted by someone else. (Q92_3) 
recode q92_3 (1=1) (2=0), gen(q92_3_01)	
tab q92_3 q92_3_01
	*Post your own thoughts or comments on political issues. (Q92_2) 
recode q92_2 (1=1) (2=0), gen(q92_2_01)	
tab q92_2 q92_2_01
	*Comment on someone else's link, photo, or status update related to political issues. (Q92_4) 
recode q92_4 (1=1) (2=0), gen(q92_4_01)	
tab q92_4 q92_4_01
	*Q88 Do you ever post on social media?
recode q88 (1=1) (2=0), gen(q88_01)	
tab q88 q88_01
	*look at latent structure (alpha = 0.8580)
factor q92_1_01 q92_2_01 q92_3_01 q92_4_01, ipf
alpha q92_1_01 q92_2_01 q92_3_01 q92_4_01
	*make a count of the things they do
egen polpost = rowtotal(q92_1_01 q92_2_01 q92_3_01 q92_4_01)
tab polpost

*flip At some point in the future, I might want to run for political office. (Q38_1) 
gen run_office=.
replace run_office=1 if q38_1==5
replace run_office=2 if q38_1==4
replace run_office=3 if q38_1==3
replace run_office=4 if q38_1==2
replace run_office=5 if q38_1==1
tab q38_1 run_office

*leave as-is (scored lo-hi): Engaged in civil disobedience (Q39_5)

*flip Overall, I feel very qualified to run for public office. (Q38_2) 
gen qual_office=.
replace qual_office=1 if q38_2==5
replace qual_office=2 if q38_2==4
replace qual_office=3 if q38_2==3
replace qual_office=4 if q38_2==2
replace qual_office=5 if q38_2==1
tab q38_2 qual_office

*leave as-is (scored lo-hi): Taken part in a protest or demonstration (Q39_1) 
*leave as-is (scored lo-hi): Volunteered during an election (Q39_4) 
*leave as-is (scored lo-hi): Attended a political meeting (Q39_2) 
*leave as-is (scored lo-hi): Contacted an elected official (Q39_3) 

*flip People like me can influence government. (Q40_1) 
recode q40_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(q40_1_flip)	
tab q40_1 q40_1_flip

*Q104 Do you currently, or have you ever, owned crypto-currency?
recode q104 (1=1) (2=0), gen(has_crypto)
tab q104 has_crypto

*covid vax: Q28 Have you personally received at least one dose of a COVID-19 vaccine? (1=y, 2=n)
gen yes_vax=.
replace yes_vax=0 if q28==2
replace yes_vax=1 if q28==1
tab q28 yes_vax
pwcorr WR_ave yes_vax
ttest WR_ave, by(yes_vax)

*run corr analyses (use "ci2" to get the ci's)
ci2 WR_ave q99_3_flip, corr
ci2 WR_ave q99_1_flip, corr
ci2 WR_ave q99_2_flip, corr
ci2 WR_ave q39_6, corr
ci2 WR_ave share_false, corr
ci2 WR_ave q49_1_flip, corr
ci2 WR_ave conflict, corr
ci2 WR_ave q92_1_01, corr
ci2 WR_ave q49_2_flip, corr
ci2 WR_ave q92_3_01, corr
ci2 WR_ave q92_2_01, corr
ci2 WR_ave q92_4_01, corr
ci2 WR_ave q49_3_flip, corr
ci2 WR_ave q88_01, corr
ci2 WR_ave run_office, corr
ci2 WR_ave q39_5, corr
ci2 WR_ave qual_office, corr
ci2 WR_ave q39_1, corr
ci2 WR_ave q39_4, corr
ci2 WR_ave q39_2, corr
ci2 WR_ave q39_3, corr
ci2 WR_ave q40_1, corr
ci2 WR_ave q40_1_flip, corr
ci2 WR_ave has_crypto, corr
ci2 WR_ave yes_vax, corr
ci2 WR_ave enjoy_argue, corr
ci2 WR_ave polpost, corr


*do above but for white respondents only
preserve
keep if white==1
ci2 WR_ave q99_3_flip, corr
ci2 WR_ave q99_1_flip, corr
ci2 WR_ave q99_2_flip, corr
ci2 WR_ave q39_6, corr
ci2 WR_ave share_false, corr
ci2 WR_ave q49_1_flip, corr
ci2 WR_ave conflict, corr
ci2 WR_ave q92_1_01, corr
ci2 WR_ave q49_2_flip, corr
ci2 WR_ave q92_3_01, corr
ci2 WR_ave q92_2_01, corr
ci2 WR_ave q92_4_01, corr
ci2 WR_ave q49_3_flip, corr
ci2 WR_ave q88_01, corr
ci2 WR_ave run_office, corr
ci2 WR_ave q39_5, corr
ci2 WR_ave qual_office, corr
ci2 WR_ave q39_1, corr
ci2 WR_ave q39_4, corr
ci2 WR_ave q39_2, corr
ci2 WR_ave q39_3, corr
ci2 WR_ave q40_1, corr
ci2 WR_ave q40_1_flip, corr
ci2 WR_ave has_crypto, corr
ci2 WR_ave yes_vax, corr
ci2 WR_ave enjoy_argue, corr
ci2 WR_ave polpost, corr
restore

***
***

*save our replication data set
save "/Users/caseyklofstad/Dropbox/NSF Conspiracy Theory Surveys/spring 2022 survey/white replacement paper/replication files/white replacment replication data.dta", replace
